﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Controls;
using Assergs.Windows.Controls;

namespace Assergs.Windows
{
    public partial class ToolWindowDockPanel 
    {
        public void CloseToolWindows(ToolWindow tw)
        {
            foreach (ToolWindowTabItemContainer tabItem in this._PART_WindowsTabs_Element.Items)
            {
                ToolWindowTabItemContainerPanel panel = tabItem.Content as ToolWindowTabItemContainerPanel;
                ToolWindow window = panel.Children[0] as ToolWindow;
                if (window == tw)
                {
                    ToolWindow_TabClosedEvent(tabItem, new System.Windows.RoutedEventArgs());
                    return;
                }
            }
        }
    }
}
